# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Justin Berthault <justin.berthault@zaclys.net>
pkgname=jgmenu
pkgver=4.4.1
pkgrel=1
pkgdesc="Simple, independent X11 menu"
url="https://github.com/johanmalm/jgmenu"
arch="all"
license="GPL-2.0-only"
depends="
	bash
	desktop-file-utils
	python3
	"
makedepends="
	librsvg-dev
	libxrandr-dev
	libxml2-dev
	menu-cache-dev
	pango-dev
	xfce4-panel-dev
	"
checkdepends="perl xvfb-run"
subpackages="$pkgname-doc $pkgname-xfce4"
source="$pkgname-$pkgver.tar.gz::https://github.com/johanmalm/jgmenu/archive/v$pkgver.tar.gz"

build() {
	export CFLAGS="$CFLAGS -flto=auto"

	./configure \
		--prefix=/usr \
		--with-gtktheme \
		--with-lx \
		--with-pmenu \
		--with-xfce4-panel-applet
	make
}

check() {
	export XDG_RUNTIME_DIR="$builddir"
	xvfb-run -a make test
}

package() {
	make DESTDIR="$pkgdir" install
}

xfce4() {
	pkgdesc="$pkgdesc (xfce4 panel integration)"

	amove usr/lib/xfce4 usr/share/xfce4
}

sha512sums="
e09ff357e99e58ba63f0a9e8c9c8d1164bcc588bfda565139a8d9b35bb76683e284952feb12680830bec8188957c5b7aec6c89817962fb368381b80046d43ae0  jgmenu-4.4.1.tar.gz
"
